<?xml version="1.0" encoding="UTF-8"?>

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html">
    
    
    <ui:composition template="/pages/user/templates/userAdminTemplate.xhtml">
        <ui:define name="pageTitle">
            <h:outputText value="Manage Users"/>
        </ui:define>
    
        <ui:define name="centerPane">
            <h:form>
                <h:commandButton value="create" action="gotoCreateUser"/>
                    <h:dataTable 
                            value="#{manageUsersAction.users}" 
                            var="user" 
                            styleClass="dataTable"
                            cellpadding="0px"
                            cellspacing="0px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="USER ID"/>
                            </f:facet>
                            <h:outputText value="#{user.userId}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="USERNAME"/>
                            </f:facet>
                            <h:outputLink value="#{context}/pages/user/admin/viewUserDetails.jsf">
                                <f:param name="userId" value="#{user.userId}"/>
                                <h:outputText value="#{user.username}"/>
                            </h:outputLink>
                        </h:column>
                        <h:column>
                            <h:outputLink value="#{context}/pages/user/admin/editUser.jsf">
                                <f:param name="userId" value="#{user.userId}"/>
                                <h:outputText value="[edit]"/>
                            </h:outputLink>
                        </h:column>
                        <h:column>                        
                            <h:outputLink value="#{context}/pages/user/admin/deleteUser.jsf">
                                <f:param name="userId" value="#{user.userId}"/>
                                <h:outputText value="[delete]"/>
                            </h:outputLink>
                        </h:column>
                    </h:dataTable>
                <h:commandButton value="create" action="gotoCreateUser"/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
